<%@ include file="/WEB-INF/tiles/include.jsp"%>

<script type="text/javascript">
	
	$(document).ready(function() {
		$("#modalbox_save").click(function() {
			$.wis.util.doSave()
		});
	
		$("#facebox_close").click(function() {
			$.facebox.close()   
		});
	
	});
</script>

<form:form id="editForm" commandName="commandCurrency" method="post" action="${pageContext.request.contextPath}/basic/masterdata/currency.save">
	<form:hidden path="pgIndex"/>
	<form:hidden path="pgRows"/>
	<form:hidden path="pgTotal"/>
	<form:hidden path="id"/>
	<form:hidden path="strAction"/>

<table class="tableInput">
	<tr>
		<th class="field"><spring:message code="label.currabrev" />&nbsp;:</th>
		<td class="even"><form:input path="currabrev" size="3" maxlength="3"/></td>
	</tr>
	<tr>
		<th class="field"><spring:message code="label.currency" />&nbsp;:</th>
		<td class="odd"><form:input path="currency" size="30" maxlength="30"/></td>
	</tr>
	<tr>
		<th class="field"><spring:message code="label.hundredsname" />&nbsp;:</th>
		<td class="even"><form:input path="hundredsname" size="15" maxlength="15"/></td>
	</tr>
	<tr>
		<th class="field"><spring:message code="label.country" />&nbsp;:</th>
		<td class="odd">
			<c:choose>
				<c:when test="${not empty commandCurrency.id}">
					<b>
					<c:forEach items="${commandCurrency.countryList}" var="country" varStatus="countrySt">
						<c:if test="${commandCurrency.countryId == country.stValue}">
							${country.stLabel}
						</c:if>
					</c:forEach>
					</b>
					<form:hidden path="countryId"/>	
				</c:when>
				<c:otherwise>
					<form:select path="countryId"
							items="${commandCurrency.countryList}"
							itemLabel="stLabel" itemValue="stValue"/>
				</c:otherwise>
			</c:choose>
		</td>
	</tr>
</table>
<table class="tableButton">
	<tr><td align="left">
		<span class="button"><a href="#modalbox_save" id="modalbox_save"><spring:message code="button.save"/></a></span>
		<span class="button"><a href="#facebox_close" id="facebox_close"><spring:message code="button.cancel"/></a></span>
	</td></tr>
</table>
</form:form>